import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysToolDictField = (params) => {
  params.head.transCode = 'querySysToolDictField';
  return request({
    url: '/tool/sysToolDictField/querySysToolDictField',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysToolDictFieldListPage = (params) => {
  params.head.transCode = 'querySysToolDictFieldListPage';
  return request({
    url: '/tool/sysToolDictField/querySysToolDictFieldListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveSysToolDictField = (params) => {
  params.head.transCode = 'saveSysToolDictField';
  return request({
    url: '/tool/sysToolDictField/saveSysToolDictField',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveSysToolDictFieldList = (params) => {
  params.head.transCode = 'saveSysToolDictFieldList';
  return request({
    url: '/tool/sysToolDictField/saveSysToolDictFieldList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateSysToolDictField = (params) => {
  params.head.transCode = 'saveOrUpdateSysToolDictField';
  return request({
    url: '/tool/sysToolDictField/saveOrUpdateSysToolDictField',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateSysToolDictFieldList = (params) => {
  params.head.transCode = 'saveOrUpdateSysToolDictFieldList';
  return request({
    url: '/tool/sysToolDictField/saveOrUpdateSysToolDictFieldList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateSysToolDictField = (params) => {
  params.head.transCode = 'updateSysToolDictField';
  return request({
    url: '/tool/sysToolDictField/updateSysToolDictField',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysToolDictField = (params) => {
  params.head.transCode = 'deleteSysToolDictField';
  return request({
    url: '/tool/sysToolDictField/deleteSysToolDictField',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysToolDictFieldList = (params) => {
  params.head.transCode = 'deleteSysToolDictFieldList';
  return request({
    url: '/tool/sysToolDictField/deleteSysToolDictFieldList',
    method: 'post',
    data: params
  })
}
//动态标准化变量  
export const autoGetSysToolDictFieldList = (params) => {
  params.head.transCode = 'autoGetSysToolDictFieldList';
  return request({
    url: '/tool/sysToolDictField/autoGetSysToolDictFieldList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysToolDictFieldExcel = (params) => {
  downloadExcel({
    url: '/tool/sysToolDictField/excelDownload/exportSysToolDictFieldExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
